Skip to content

HDDS-7781. Change Get Key Info to return HSync info#4460

Merged
jojochuang merged 4 commits into
apache:masterfrom
jojochuang:HDDS-7781
Mar 28, 2023
Merged

HDDS-7781. Change Get Key Info to return HSync info#4460
jojochuang merged 4 commits into
apache:masterfrom
jojochuang:HDDS-7781

Conversation

@jojochuang
Copy link
Copy Markdown
Contributor

@jojochuang jojochuang commented Mar 23, 2023

What changes were proposed in this pull request?

Add a isHsync field in OmKeyInfo. This field is not persisted in RocksDB but rather is inferred from the metadata if it has HSYNC_CLIENT_ID field.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-7781

How was this patch tested?

Unit tests

Change-Id: Ib1c8ef8c517a77bea76407a6a356e2320e36fccb
Change-Id: I94d4a9ee17d4ccebdb231a38373d075a3e9532f5
Change-Id: I0dce6b498db984fd0b6c5ceda1e2203ccb0d482d
@jojochuang jojochuang requested a review from szetszwo March 23, 2023 18:17
public Builder addAllMetadata(Map<String, String> newMetadata) {
metadata.putAll(newMetadata);

setHSync(metadata.containsKey(OzoneConsts.HSYNC_CLIENT_ID));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smengcl this is what I was referring to.

Copy link
Copy Markdown
Contributor

@smengcl smengcl Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Thanks!

The final goal is to prevent other clients from opening the file while the first client hasn't closed the hsync'ed file yet correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we want to enable this behavior such that any client can forcefully close open files (HBase expects this)

Change-Id: Ic92b5a2430222f368307b837f3bfe22bef24fb5e
Copy link
Copy Markdown
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

@jojochuang jojochuang merged commit d9a1662 into apache:master Mar 28, 2023
@jojochuang jojochuang added the hbase HBase on Ozone support label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hbase HBase on Ozone support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants